<template>
  <div>
    <span>son1</span>
    <!-- {{money}} -->
    <button @click="change">改变父组件的钱数</button>
    <Grandson v-bind="$attrs"></Grandson>
  </div>
</template>
<script>
  import Grandson from './grandson.vue'
  export default {
    name: 'son1',
    components: {
      Grandson,
    },
    props: {
      /*money: {
        type: Number,
         default: 0
      },*/
      changeMoney: {
        type: Function,
        default: () => {}
      }
    },
    data() {
      return {}
    },
    methods: {
      change() {
        // this.changeMoney && this.changeMoney(400)
        this.$emit('change-money', 300)
      }
    }

  }
</script>
<style>

</style>